package com.example.drive.net.callback

import android.util.Log
import okhttp3.Response

/**
 * 返回二进制数据
 */
abstract class ByteArrayCallback : NetworkCallback<ByteArray> {
    companion object {
        private const val TAG = "BitmapCallback"
    }

    override fun parseNetworkResponse(response: Response): ByteArray? {
        return kotlin.runCatching {
            response.body.bytes()
        }.getOrElse {
            Log.e(TAG, "parseNetworkResponse error:$it")
            null
        }
    }
}